<?php
$this->pageTitle = $detail[0]['item']['title'];
$this->breadcrumbs = array(
	'所有类目' => array('cate/index'),
	$parent->name => array('cate/subcate','pid'=>$parent->cid),
	'商品详情'
);
?>
<div class="goods_header">

	<h3><?php echo CHtml::link($detail[0]['item']['title'],$detail[0]['click_url']);?></h3>

</div>
<div class="similar_cates">
	<strong>返回类目重新挑选:</strong>
	<?php echo CHtml::link($parent->name,array('item/list','cid'=>$parent->cid),array('target'=>'_blank'));?>
</div>

<div class="goods">
	<div class="detail_img">
		<a title="点击图片开始购买" href="<?php echo $detail[0]['click_url'];?>"><img alt="商品预览图片，点击即可进行购买" src="<?php echo $detail[0]['item']['pic_url'];?>" /></a>
	</div>
	<dl class="good_detail" id="detail">
		<dd><span>价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格 ：</span> ￥<strong style="font-size:28px;color:#f60;"><?php echo $detail[0]['item']['price'];?></strong></dd>
		<dd><span>所在城市 ：</span> <?php echo $detail[0]['item']['location']['city']==$detail[0]['item']['location']['state'] ? $detail[0]['item']['location']['state'] : $detail[0]['item']['location']['state'] .' '. $detail[0]['item']['location']['city'];?></dd>
		<dd><span>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费 ：
		<?php
			if ($detail[0]['item']['freight_payer'] == 'seller'){
				echo '卖家包邮';
			}else{
				echo '快递: '.$detail[0]['item']['express_fee'];
				echo ' &nbsp;&nbsp;&nbsp;EMS: '.$detail[0]['item']['ems_fee'];
				echo ' &nbsp;&nbsp;&nbsp;平邮: '.$detail[0]['item']['post_fee'];
			}
		?>
		</dd>
		<dd><span>商品数量 ：</span> <?php echo $detail[0]['item']['num'];?> 件</dd>
		<dd><span>新旧程度 ：</span> <?php echo $detail[0]['item']['stuff_status']=='new' ? '全新' : ($detail[0]['item']['stuff_status'] == 'unused' ? '闲置' : '二手');?></dd>
		<dd><span>会员打折 ：</span> <?php echo $detail[0]['item']['has_discount'] ? '支持' : '不支持';?></dd>
		<dd><span>卖家信用 ：</span> <img style="vertical-align:text-top;" src="<?php echo Yii::app()->baseUrl.'/images/credit/'.$detail[0]['seller_credit_score'].'.gif';?>" /></dd>
		<dd><span>上架时间 ：</span> <?php echo $detail[0]['item']['list_time'];?></dd>
		<dd class="buyer_click">
			<a class="shop" onfocus="this.blur();" href="<?php echo $detail[0]['click_url'];?>" target="_blank">现在购买</a>
                        <a class="buy" onfocus="this.blur();" href="<?php echo $detail[0]['shop_click_url'];?>" target="_blank">逛逛店铺</a>
		</dd>
	</dl>
	<div class="clear"></div>
	<div>
		<h3 class="detailimg_title">图片预览</h3>
		<div class="detail_images">
			<?php
			foreach($detail[0]['item']['item_imgs']['item_img'] as $detail_images){
				echo "<a title=\"点击图片开始购买\" href=\"".$detail[0]['click_url']."\"><img alt=\"商品预览图片，点击即可进行购买\" src=".$detail_images['url']."  /></a>";
			}
			?>
		</div>
	</div>
</div>
<?php
Yii::app()->clientScript->registerScript('imgThumb',"
$(window).load(function(){ 
	$('.detail_images img').each(function (){
		var w = $(this).width();
		if(w>660){
			$(this).width(660);
		}
	});
});
");
?>
